<?php /*a:2:{s:49:"D:\phpstudy\WWW\tp6\view\admin\system\system.html";i:1577079769;s:42:"D:\phpstudy\WWW\tp6\view\admin\layout.html";i:1577177850;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>管理平台</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" type="text/css" href="/static/css/iconfont.css" media="all"/>
    <!-- <link rel="stylesheet" type="text/css" href="/static/css/iconfont2.css"/> -->
    <link rel="stylesheet" href="/static/lib/layuiadmin/layui/css/layui.css">
    <link rel="stylesheet" href="/static/lib/layuiadmin/style/admin.css" media="all">

    <link rel="stylesheet" href="/static/lib/layuiadmin/layui/css/layui.seller.css">
    <link rel="stylesheet" type="text/css" href="/static/css/style.css"/>
    <script src="/static/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/static/lib/layuiadmin/layui/layui.js"></script>
    <script>
        var Jshop_Host = "http://jshop.com";
        var Jshop_Image = "/index.php/manage/images/uploadimage.html";
        var manage_Image = "/index.php/manage/images/manage.html";
    </script>
    <script src="/static/js/app.js"></script>
    <script type="text/javascript" charset="utf-8" src="/static/js/ue/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/static/js/ue/ueditor.all.min.js"> </script>
</head>
<body>
<div class="layui-fluid">
    <style>
    .layui-form-item label {
        width: 120px;
    }
    .classifyimg{
        margin-bottom: 20px;
        width: 672px !important;
    }
    .classifyimg-item{
        display: inline-block;
        width: 140px;
    }
    .classifyimg img{
        width: 100px;
        display: block;
    }
    .classifyimg .layui-form-radio{
        vertical-align: top;
        display: block;
        margin-bottom: 10px;
    }
    .image_storage_type .item{
        display: none;
    }
</style>
<div class="layui-card" style="padding:10px;">

    <div class="layui-tab" lay-filter="setting">
        <ul class="layui-tab-title">
<!--            <li lay-id="platform" class="layui-this">平台设置</li>-->
<!--            <li lay-id="share">分享设置</li>-->
<!--            <li lay-id="users">会员设置</li>-->
<!--            <li lay-id="goods">商品设置</li>-->
<!--            <li lay-id="order">订单管理</li>-->
<!--            <li lay-id="points">积分设置</li>-->
<!--            <li lay-id="cash">提现设置</li>-->
<!--            <li lay-id="other">其他设置</li>-->
            <?php if(is_array($systemGroup) || $systemGroup instanceof \think\Collection || $systemGroup instanceof \think\Paginator): $i = 0; $__LIST__ = $systemGroup;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
            <li lay-id="<?php echo htmlentities($vo['id']); ?>" <?php if($key+1 == 1): ?> class="layui-this" <?php endif; ?>><?php echo htmlentities($vo['name']); ?></li>
            <?php endforeach; endif; else: echo "" ;endif; ?>
        </ul>
        <div class="layui-tab-content">


            <?php foreach($systemGroup as $key=>$vo): ?>
            <div class="layui-tab-item <?php if($key+1 == 1): ?>layui-show<?php endif; ?>">

                <form class="layui-form seller-alone-form" action="" method="post">

                    <?php if(array_key_exists($vo['id'],$system)): foreach($system[($key+1)] as $k=>$v): if($v['status']): if($v['type'] =='text'): ?>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><?php echo htmlentities($v['name']); ?>：</label>
                        <div class="layui-input-inline seller-inline-5">
                            <input type="text" name="<?php echo htmlentities($v['field']); ?>" value="<?php echo htmlentities($v['value']); ?>" lay-verify="title" autocomplete="off" placeholder="<?php echo htmlentities($v['tips']); ?>" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux"><?php echo htmlentities($v['tips']); ?></div>
                    </div>
                    <?php endif; ?>
                    <?php endif; ?>
                    <?php endforeach; ?>
                    <?php endif; ?>
                    <div class="layui-form-item">
                        <label class="layui-form-label">&nbsp;</label>
                        <div class="layui-input-block">
                            <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="save" style="height: 37px;padding: 0 27px;font-size: 14px;">保存</button>
                        </div>
                    </div>

                </form>
            </div>
            <?php endforeach; ?>

        </div>
    </div>
</div>

<script>
    layui.use(['form', 'element', 'table'], function() {
        var form = layui.form, element = layui.element, table = layui.table;
        //显示当前tab
        if (location.hash) {
            element.tabChange('setting', location.hash.replace(/^#/, ''));
        }
        element.on('tab(setting)', function () {
            var othis = $(this), layid = othis.attr('lay-id');
            if (layid) {
                location.hash = layid;
            }
        });
        //保存商品
        form.on('submit(save)', function(data) {
            formData = data.field;

            if (!formData) {
                layer.msg('请先完善数据', {
                    time: 1300
                }); //layer.msg(JSON.stringify(data.field));
                return false;
            }
            JsPost('<?php echo url("System/systemPost"); ?>',formData,function(e){


                if (e.code === 1) {
                    layer.msg('保存成功');
                } else {
                    layer.msg(e.msg, {
                        time: 1300
                    });
                }
            });
            return false;
        });
        //积分奖励类型切换
        var type = $("#sign_point_type").val();
        if (type == 1) {
            $(".sign-random").hide();
            $(".sign-fixed").show();
        } else {
            $(".sign-random").show();
            $(".sign-fixed").hide();
        }
        form.on('radio(sign_point_type)', function(data) {
            if (data.value == 1) {
                $(".sign-random").hide();
                $(".sign-fixed").show();
            } else {
                $(".sign-random").show();
                $(".sign-fixed").hide();
            }
        });
        //存储引擎切换
        form.on('select(image_storage_type)', function(data) {
            $(".image_storage_type .item").hide(10);
            $("."+data.value).show(10);
        });

        //监听文章列表页工具条
        table.on('tool(articleTable)', function(obj){ //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
            var data = obj.data; //获得当前行数据
            var layEvent = obj.event; //获得 lay-event 对应的值（也可以是表头的 event 参数对应的值）
            var tr = obj.tr; //获得当前行 tr 的DOM对象
            if(layEvent === 'selectArticle'){ //选择
                var article_id_key = $("#article_id_key").val();
                var article_name_key = $("#article_name_key").val();
                $("#"+article_id_key).val(data.id);
                $("#"+article_name_key).val(data.title);
                layer.close(window.box);
            }
        });
    });
    function article_list(id, name)
    {
        JsGet("<?php echo url('Carousel/getArticle'); ?>?article_id_key="+id+"&article_name_key="+name,function(e){
            window.box = layer.open({
                type: 1,
                content: e,
                area: ['700px', '450px'],
                title:'文章列表'
            });
        });
    }
</script>
</div>
</body>
</html>
